<template>
  <div id="app">


    <router-view />
  </div>
</template>

<style lang="less">
@import url(/src/assets/css/iconfont/iconfont.css);

* {
  padding: 0;
  margin: 0;
}

#app {
  height: 20rem;
  background: #f5f5f5;
}
</style>

<script>

function adapter() {
  //获取布局视口宽度，因为开启了理想视口，布局视口=设备横向独立像素值
  const dpWidth = document.documentElement.clientWidth
  //计算根字体大小
  const rootFonstSize = (dpWidth * 100) / 1125
  //设置根字体大小
  document.documentElement.style.fontSize = rootFonstSize + 'px'
}
adapter()
window.onresize = adapter
</script>
